<template>
	<view class="container">
		<u-toast ref="uToast" />
		<u-navbar :is-back="true" title="校内会议" back-icon-color='#333333' height="50" :border-bottom="false">
		</u-navbar>
		<view class="list">
			<view class="per_conference">
				<view class="name">
					<text>名称</text>
					<text>{{teacher_obj.base_info?teacher_obj.base_info
.name:""}}</text>
				</view>
				<view class="type">
					<text>类型</text>
					<text>{{teacher_obj.base_info?teacher_obj.base_info
.type:''}}</text>
				</view>
				<view class="time">
					<text>时间</text>
					<text>{{startTime}}</text>
					<text></text>
					<text>-</text>
					<text>{{endTime}}</text>
					<text></text>
				</view>
				<view class="address">
					<text>地点</text>
					<text></text>
				</view>
				<view class="principal">
					<text>负责人</text>
					<text>{{teacher_obj.user_lists?teacher_obj.user_lists[0].full_name:''}}</text>
				</view>
				<view class="participant">
					<text>参与人</text>
					<text>{{teacher_obj.user_lists?teacher_obj.user_lists[0].full_name:''}}</text>
				</view>
				<view class="sign">
					<text>签到</text>
					<!-- <view class="toggle" @click="changeBoolen" :id="[boolen==true?'con':'']">
						<text class="circle"></text>
					</view> -->
				</view>
			</view>
		</view>
		<view class="confirm">
			<view class="verify">
				{{verify}}
			</view>
		</view>
	</view>
</template>

<script>
	import request from '../../request.js'
	import time from '../../time.js'
	export default {
		data() {
			return {
				boolen: false,
				verify: '返回',
				meetId: '',
				teacher_obj: {},
				startTime: '',
				endTime: '',
			}
		},
		onLoad(option) {
			if (option.id) {
				this.meetId = option.id;
			}
			this.meetingDetail();
		},
		methods: {
			changeBoolen() {
				this.boolen = !this.boolen;
			},
			meetingDetail() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				request({
					url: base_url + 'teacher/meeting/detail',
					method: 'post',
					data: {
						meeting_id: this.meetId ? this.meetId : 1,
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data);
							_this.teacher_obj = res.data.data;
							_this.startTime = time.format(_this.teacher_obj.base_info
								.start_time);
							_this.endTime = time.format(_this.teacher_obj.base_info.end_time);
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.container {
		width: 100%;
		height: 100vh;
		background-color: #F2F2F2;

		.list {
			width: 100%;
			overflow: hidden;

			.per_conference {
				width: 710rpx;
				height: 430rpx;
				border-radius: 12rpx;
				background-color: #fff;
				margin-left: 20rpx;
				margin-top: 20rpx;

				.name {
					width: 100%;
					height: 55rpx;
					display: flex;
					justify-content: flex-start;

					text {
						font-size: 26rpx;
						margin-top: 20rpx;

						&:nth-child(1) {
							margin-left: 22rpx;
							color: #777777;

						}

						&:nth-child(2) {
							margin-left: 72rpx;
							color: #333333;
						}
					}
				}

				.type {
					width: 100%;
					height: 55rpx;
					display: flex;
					justify-content: flex-start;

					text {
						font-size: 26rpx;
						margin-top: 20rpx;

						&:nth-child(1) {
							margin-left: 22rpx;
							color: #777777;

						}

						&:nth-child(2) {
							margin-left: 72rpx;
							color: #333333;
						}
					}
				}

				.time {
					width: 100%;
					height: 55rpx;
					display: flex;
					justify-content: flex-start;

					text {
						font-size: 26rpx;
						margin-top: 20rpx;

						&:nth-child(1) {
							margin-left: 22rpx;
							color: #777777;
						}

						&:nth-child(2) {
							margin-left: 72rpx;
							color: #333333;
						}

						&:nth-child(3) {
							margin-left: 12rpx;
							color: #333333;
						}

						&:nth-child(4) {
							color: #333333;
						}

						&:nth-child(5) {
							color: #333333;
						}

						&:nth-child(6) {
							margin-left: 12rpx;
							color: #333333;
						}
					}
				}

				.address {
					width: 100%;
					height: 55rpx;
					display: flex;
					justify-content: flex-start;

					text {
						font-size: 26rpx;
						margin-top: 20rpx;

						&:nth-child(1) {
							margin-left: 22rpx;
							color: #777777;

						}

						&:nth-child(2) {
							margin-left: 72rpx;
							color: #333333;
						}
					}
				}

				.principal {
					width: 100%;
					height: 55rpx;
					display: flex;
					justify-content: flex-start;

					text {
						font-size: 26rpx;
						margin-top: 20rpx;

						&:nth-child(1) {
							margin-left: 22rpx;
							color: #777777;

						}

						&:nth-child(2) {
							margin-left: 55rpx;
							color: #333333;
						}
					}
				}

				.participant {
					width: 100%;
					height: 55rpx;
					display: flex;
					justify-content: flex-start;

					text {
						font-size: 26rpx;
						margin-top: 20rpx;

						&:nth-child(1) {
							margin-left: 22rpx;
							color: #777777;

						}

						&:nth-child(2) {
							margin-left: 55rpx;
							color: #333333;
						}
					}
				}

				.sign {
					width: 100%;
					height: 55rpx;
					display: flex;
					justify-content: flex-start;

					text {
						font-size: 26rpx;
						margin-top: 20rpx;

						&:nth-child(1) {
							margin-left: 22rpx;
							color: #777777;

						}
					}

					.toggle {
						background-color: #CCCCCC;
						overflow: hidden;
						width: 164rpx !important;
						position: relative;
						height: 29rpx !important;
						margin-top: 20rpx;
						margin-left: 22rpx;
						border-radius: 20rpx;

						.circle {
							width: 22rpx;
							border-radius: 50%;
							position: absolute;
							top: 0rpx;
							left: 0rpx;
							background-color: #fff;
							height: 22rpx;
						}
					}
				}
			}
		}

		.confirm {
			width: 100%;
			margin-top: 200rpx;
			height: 300rpx;
			display: flex;
			justify-content: center;
			align-items: center;

			.verify {
				width: 200rpx;
				height: 60rpx;
				border-radius: 50rpx;
				text-align: center;
				line-height: 60rpx;
				background: #fff;
				color: #777777;
				font-size: 30rpx;
			}
		}
	}
</style>
